library(ggplot2)

x1 <- rnorm(3000, mean = -5, sd = 3)
y1 <- dnorm(x)
x2 <- rnorm(3000, mean = 5, sd = 2)
y2 <- dnorm(x)
aa <- data.frame(x1,y1,x2,y2)


aa1 <- ggplot(data=aa)+
  stat_function(aes(x1), fun = dnorm, colour = "#4672c4", size = 3,
                args = list(mean = mean(x1), sd = sd(x1)))+
  geom_pointrange(y = -0.02, x= mean(aa$x1), 
                  xmin = quantile (x1, 0.025, na.rm=T), 
                  xmax = quantile (x1, 0.975, na.rm=T),
                  colour = "#4672c4", size = 2)+
  stat_function(aes(x2), fun = dnorm, colour = "#ed6565", size = 3,
                args = list(mean = mean(x2), sd = sd(x2)))+
  geom_pointrange(y = -0.03, x= mean(aa$x2), 
                  xmin = quantile (x2, 0.025, na.rm=T), 
                  xmax = quantile (x2, 0.975, na.rm=T),
                  colour = "#ed6565", size = 2)+
  geom_hline(aes(yintercept = -0.005), size = 1)+
  geom_hline(aes(yintercept = -0.005), size = 1)+
  scale_y_continuous(limits=c(-0.04,0.2))+
  scale_x_continuous(limits=c(-18,18))+
  theme_void()

ggsave(file = "aa1.png",plot = aa1, width = 10, height = 2)